package com.hhs.storage.controller;


import com.hhs.storage.service.ProjectMemberService;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.Map;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author hhs
 * @since 2023-01-13
 */
@RestController
@RequestMapping("/projectMember")
public class ProjectMemberController {
    @Resource
    private ProjectMemberService projectMemberService;
    @RequestMapping("/getMembersByProjectId")
    public Map<String,Object> getMembersByProjectId(@RequestParam String projectId){
        return  projectMemberService.getMembersByProjectId(projectId);
    }
    @RequestMapping("/addMember")
    public Map<String,Object> addMember(@RequestParam String projectId,@RequestParam String memberId){
        return  projectMemberService.addMember(projectId,memberId);
    }
    @RequestMapping("/removeMember")
    public Map<String,Object> removeMember(@RequestParam String projectId,@RequestParam String memberId){
        return  projectMemberService.removeMember(projectId,memberId);
    }
    @RequestMapping("/changeIdentity")
    public Map<String,Object> changeIdentity(@RequestParam String id,@RequestParam Integer identityType){
        return  projectMemberService.changeIdentity(id,identityType);
    }
}

